<?php
include('libary/init_index.php');
if ($_POST['submit']!='')
{ 
   $poster=$_POST['poster'];
   $comment=$_POST['comment_text'];
   if (strlen($comment)>50)
   {
   $type=$_POST['type'];
   $poster=$_POST['poster'];
   $code=$_POST['code'];
   $time=time();
   $link=$_SERVER['HTTP_REFERER'];
   $comment=str_replace('"','"',$comment);
   $comment=str_replace("'","'",$comment);
   $id=dehash($code,$type);
   $cmd="INSERT INTO `comment` (comment_".$type.",comment_poster,comment_text,comment_time,comment_link) VALUES ($id,$poster,'$comment',$time,'$link')";
   @mysql_query($cmd);
   }
   header('location:'.$_SERVER['HTTP_REFERER']);
} else header('location:http://beta.cailuongso.com');
?>